// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.brest.managesambafilesharing;

import android.content.Context;
import android.net.wifi.WifiManager;

// Referenced classes of package com.funkyfresh.samba:
//            LOG, ShellCmd

public class SambaWifiInfo {

	public SambaWifiInfo(Context context1) {
		existingIP = "";
		context = context1;
		wifiManager = (WifiManager) context.getSystemService("wifi");
	}

	/*
	 * public static final String getAltIfNames() { String s; String s1; String
	 * as[]; s = null; s1 = getInterfaceList(); String s2 = getWifiName(); if(s2
	 * == null) s2 = "noWifiWTF"; as = (new String[] { s2, "wl", "eth", "ti",
	 * "tun", "tap", "ath", "ap", "ar", "bcm", "hostap", "ipw", "orino" });
	 * if(s1 != null) goto _L2; else goto _L1 _L1: s = null; _L4: return s; _L2:
	 * String as1[]; int i; int j; as1 = s1.split("\\|"); i = as1.length; j = 0;
	 * _L5: if(j >= i) goto _L4; else goto _L3 _L3: String s3; int k; int l; s3
	 * = as1[j]; k = as.length; l = 0; _L6: if(l < k) { label0: {
	 * if(!s3.startsWith(as[l])) break label0; if(s == null) s = s3; else s =
	 * (new StringBuilder(String.valueOf(s))).append(" ").append(s3).toString();
	 * } } j++; goto _L5 goto _L4 l++; goto _L6 }
	 * 
	 * private String getIfaceAddress(String s) { String s1; String s2; s1 =
	 * null; s2 = null; if(s != null) goto _L2; else goto _L1 _L1: return s1;
	 * _L2: NetworkInterface networkinterface = null; NetworkInterface
	 * networkinterface1 = NetworkInterface.getByName(s); networkinterface =
	 * networkinterface1; _L4: if(networkinterface != null) { Enumeration
	 * enumeration = networkinterface.getInetAddresses();
	 * if(enumeration.hasMoreElements()) { s2 =
	 * ((InetAddress)enumeration.nextElement()).getHostAddress(); if(s2 == null
	 * || s2.equals("0.0.0.0")) s2 = null; } s1 = s2; } if(true) goto _L1; else
	 * goto _L3 _L3: SocketException socketexception; socketexception;
	 * LOG.e((new StringBuilder("error=")).append(socketexception).toString());
	 * goto _L4 }
	 * 
	 * private static final String getInterfaceList() { String s; Enumeration
	 * enumeration; s = null; enumeration = null; Enumeration enumeration1 =
	 * NetworkInterface.getNetworkInterfaces(); enumeration = enumeration1; _L3:
	 * if(enumeration == null) goto _L2; else goto _L1 _L1:
	 * if(enumeration.hasMoreElements()) break MISSING_BLOCK_LABEL_69; _L2:
	 * LOG.i((new
	 * StringBuilder("getInterfaceList() configured interfaces = ")).append
	 * (s).toString()); return s; SocketException socketexception;
	 * socketexception; LOG.e((new
	 * StringBuilder("getInterfaceList() caught exception details:"
	 * )).append(socketexception).toString()); goto _L3 NetworkInterface
	 * networkinterface = (NetworkInterface)enumeration.nextElement(); if(s ==
	 * null) s = networkinterface.getName(); else s = (new
	 * StringBuilder(String.valueOf
	 * (s))).append("|").append(networkinterface.getName()).toString(); goto _L1
	 * }
	 * 
	 * private String getWifiIpAltMethod() { String s; String s1; String s2; s =
	 * null; s1 = getWifiName(); s2 = getAltIfNames(); LOG.i((new
	 * StringBuilder("1 checking for primary wifi iface "
	 * )).append(s1).toString()); if(s1 != null) s = getIfaceAddress(s1); if(s
	 * != null || s2 == null) goto _L2; else goto _L1 _L1: String as[]; int i;
	 * int j; as = s2.split("\\ "); i = as.length; j = 0; _L6: if(j < i) goto
	 * _L3; else goto _L2 _L2: LOG.i((new
	 * StringBuilder("     ADDR=")).append(s).toString()); return s; _L3: String
	 * s3 = as[j]; if(!s3.equals(s1)) goto _L5; else goto _L4 _L4: j++; goto _L6
	 * _L5: LOG.i((new
	 * StringBuilder("2 checking for wifi iface ")).append(s3).toString()); s =
	 * getIfaceAddress(s3); if(s == null) goto _L4; else goto _L2 }
	 * 
	 * public static final String getWifiName() { String s =
	 * ShellCmd.run("getprop wifi.interface", 0); if(s == null || s.length() <
	 * 2) LOG.e(
	 * "Unable to determine device wifi interface: Android property wifi.interface has not been set by the device manuf."
	 * ); return s; }
	 * 
	 * public String getWifiBssid() { String s = null; if(managedWifiIsUp()) s =
	 * wifiManager.getConnectionInfo().getBSSID(); return s; }
	 * 
	 * public String getWifiIp() { String s = null; if(managedWifiIsUp()) s =
	 * Formatter
	 * .formatIpAddress(wifiManager.getConnectionInfo().getIpAddress()); if(s ==
	 * null || s.equals("0.0.0.0")) s = getWifiIpAltMethod(); return s; }
	 * 
	 * public String getWifiSsid() { String s = null; if(managedWifiIsUp()) s =
	 * wifiManager.getConnectionInfo().getSSID(); return s; }
	 * 
	 * public boolean managedWifiIsUp() { boolean flag = true; NetworkInfo
	 * networkinfo =
	 * ((ConnectivityManager)context.getSystemService("connectivity"
	 * )).getNetworkInfo(flag); if(networkinfo == null ||
	 * !networkinfo.isConnected()) { LOG.i("Android Managed wifi is DOWN"); flag
	 * = false; } return flag; }
	 * 
	 * public boolean wifiIsUp() { String s = getWifiIp(); boolean flag;
	 * if(managedWifiIsUp()) wifiManager.getConnectionInfo().getSSID(); if(s ==
	 * null) s = "null"; if(!s.equals(existingIP)) existingIP = s; if(s == null
	 * || s.equals("0.0.0.0") || s.equals("null")) flag = false; else flag =
	 * true; return flag; }
	 */
	public String BASEDIR;
	private Context context;
	private String existingIP;
	private WifiManager wifiManager;
}
